home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////
- // MKEY.H
- //
- // header file for MKey;
- ////////////////////////////////////////////////////////////////////////////
-
- #ifndef __MKEY_H
- #define __MKEY_H
-
- #include <conio.h>
-
- #define MKEY_ID 0x0110
-
- /* Several general defines */
-
- #define ENTER 13
- #define ESCAPE 27
- #define BACKSPACE 8
- #define SPACE 32
- #define UPARROW 328
- #define DOWNARROW 336
- #define RIGHTARROW 333
- #define LEFTARROW 331
- #define TAB 15
-
- #define N_KEYS 512 // Two independent bytes
-
- #define DEFAULT_KEY_REP_DELAY 0
-
- class MKey : public bArray {
- public:
- enum keyLabel {Escape = 27, Enter = 13, num1 = 49,
- num2, num3, num4, num5, num6, num7,
- num8, num9, num0, tab=15, charQ,
- charW, charE, charR, charT, charY,
- charU, charI, charO, charP, charA=30,
- charS, charD, charF, charG, charH,
- charJ, charK, charL, charZ=44,
- charX, charC, charV, charB, charN,
- charM, keyComma, keyDot, SpaceBar=32,
- UpArrow=(256+72), DownArrow=(256+80),
- LeftArrow=(256+75), RightArrow=(256+77)};
- DWORD RepeatDelay;
- public:
- MKey (void);
- virtual inline classType isA (void) {return (MKEY_ID);};
- void KeyFlush (void);
- inline BOOL KeyPress (void) { return (kbhit());};
- inline void SetRepeatDelay (DWORD NewDelay) { RepeatDelay = NewDelay;};
- WORD GetKey (void);
- void WaitCr (void);
- WORD Update (void);
- ~MKey (void);
- };
-
- #ifndef MKEY_UNIT
- extern MKey keyb;
- #endif
- #endif
-